package org.shopen.ai.puremvc.controller.algo
{
	import org.puremvc.as3.interfaces.INotification;
	import org.puremvc.as3.patterns.command.SimpleCommand;
	import org.puremvc.as3.utilities.statemachine.StateMachine;
	import org.shopen.ai.puremvc.model.settings.SettingsProxy;

	public class HandleEnteringSearchingCommand extends SimpleCommand
	{
		override public function execute(notification:INotification):void
		{
			var proxy : SettingsProxy = facade.retrieveProxy(SettingsProxy.NAME) as SettingsProxy;
			// in case active settings are not valid - do not begin searching
			if (proxy.areCurrentSettingsValid() == false)
			{
				sendNotification(StateMachine.CANCEL, notification.getBody(), notification.getType());
			}
		}
	}
}